/*
 * @Descripttion: localStorage操作
 * @Date: 2021-12-14 15:48:11
 * @LastEditTime: 2021-12-14 15:48:11
 */
export const storage = {
  set: (key, data) => {
    try {
      return localStorage.setItem(key, JSON.stringify(data))
    } catch (err) {
      return localStorage.setItem(key, data)
    }
  },
  get: key => {
    try {
      return JSON.parse(localStorage.getItem(key))
    } catch (err) {
      return localStorage.getItem(key)
    }
  },
  remove: key => {
    localStorage.removeItem(key)
  }
}
